﻿using com.guojin.core.io.message;
using com.guojin.mj.net.message.login;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NoticeController
{
    private static NoticeController instance;
    public static NoticeController GetInstance()
    {
        if (instance == null)
        {
            instance = new NoticeController();
        }
        return instance;
    }

    public Dictionary<string, string> dictionary = new Dictionary<string, string>(); //显示提示消息7.11

    public NoticeController()
    {
        SetNoticeDictionary();
    }

    public void OnReceiveMsg711(string msg, Message data)
    {
        var noticeRet = (NoticeRet)data;

        if (dictionary.ContainsKey(noticeRet.key))
            TooL.ShowNoticePage(dictionary[noticeRet.key]);
    }

    private void SetNoticeDictionary()
    {
        dictionary.Add("room.alreadyCreateRoom", "已经创建过房间!");
        dictionary.Add("room.noGold", "房卡不够创建房间!");
        dictionary.Add("room.noGoldToJoin", "房卡不够加入房间!");
        dictionary.Add("room.full", "房间满了!");
        dictionary.Add("room.errorRoomCheckId", "不存在的房间!");
        dictionary.Add("room.gameIsStart", "已经开始,不能够加入！");
        dictionary.Add("room.cannotExitRoom", "已经开始，不能退出！!");
        dictionary.Add("room.alreadyJoinRoom", "已经进入房间!");
        dictionary.Add("room.alreadyExitRoom", "已经退出房间!");
        dictionary.Add("room.alreadyDelRoom", "已经解散房间!");
        dictionary.Add("room.createRoomError", "房间创建失败,请重试!");
        dictionary.Add("room.cannotJoinClubRoom", "非俱乐部成员不能加入俱乐部房间！");
        dictionary.Add("room.serverIsUnderMaintenance", "服务器正在维护中！");
    }
}
